// 
class Animal {
    constructor(name) {
        this.name = name;
        this.thirst = 100;
        this.belly = [];
    }
    drick() {
        this.thirst -= 10;
        return this;
    }
    eat(food) {
        this.belly.push(food);
        return this;
    }
}

class Dog extends Animal {
    constructor(name, breed) {
        super(name);
        this.breed = breed;// 子类新增的
    }
    back() {
        console.log('狗叫');
    }
}

const sunny = new Dog('sunny', 'Golden Doodle');
sunny
    .eat('烤鱼')
    .drick()
    .eat('火锅')
    .drick();
// return this 实现 链式调用
console.log(sunny);